package com.sunnada.demo.controller;

import com.sunnada.demo.bean.User;
import com.sunnada.demo.service.UserSpecificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @program: mybatisproject2
 * @description:测试specification
 * @author: 李瑞益
 * @create: 2018-11-07 10:45
 **/
@Controller
@RequestMapping("/Specification")
public class SpecificationController {

    @Autowired
    private UserSpecificationService userSpecificationService;

    @RequestMapping("/find1")
    public String find(String userName, Model model){
        List<User> users = userSpecificationService.find(userName);
        model.addAttribute("DataList",users);
        return "Specification/user";
    }
}
